package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author stone
 * @date 2022/07/11 15:51
 */
@Controller
public class HelloController {

    //@RequestMapping(value = {"hello"})
    @RequestMapping({"hello","hello2","hello3"})
    @ResponseBody
    public BaseRespVo hello() {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setData("hello requestmapping");
        baseRespVo.setMsg("成功");
        baseRespVo.setStatus(200);
        return baseRespVo;
    }

    // 在value属性中使用通配符*
    @RequestMapping({"goodbye*", "goodbye/*"})
    @ResponseBody
    public BaseRespVo goodbye() {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setData("拜拜了");
        baseRespVo.setStatus(200);
        return baseRespVo;
    }
}
